Skip to main content

EVN OCR API

Objective

The Vietnam Electricity (EVN) OCR API authenticates the EVN bills by comparing user-entered data with text extracted from uploaded bill images.

InputOutput
An image or PDF file containing a user's EVN BillA list of detailed information extracted from the document
DID YOU KNOW?

Vietnam Electricity (EVN) is the national and the sole public power company in Vietnam.

API Endpoint

verifyEVN

Overview

The API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should upload all images and files as form-data through a POST request.

Authentication

You need a unique pair of application ID (appId) and application key (appKey) from HyperVerge to verify your identity for accessing the API.

API Request Details

Method - POST

Headers

ParameterMandatory or OptionalDescriptionAllowed Values
content-type MandatoryThis parameter defines the media type for the request payloadapplication/json
appId MandatoryThe application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value
appKey MandatoryThe application key shared by HyperVerge. You can find the details in the dashboard's credentials tab.This should be a unique value
transactionIdMandatoryA unique identifier for tracking a user journeyThis should be both unique and easily associated with the user's journey in your application(s)

Inputs

The following table provides the complete information on the parameters used in the request body for the API calls:

ParameterDescriptionMandatory or OptionalAllowed ValuesDefault Value
image1 The parameter accepts either an image or a pdf file containing the EVN BillMandatoryImage(JPG,JPEG,PNG) or PDF FileNot Applicable
name The parameter accepts the full name of the userMandatoryData Type:StringNot Applicable
address The parameter accepts the address of the userMandatoryData Type:StringNot Applicable
amount The parameter accepts the total amount after VATMandatoryData Type:StringNot Applicable
evnId The parameter accepts the EVN ID of the userMandatoryData Type:StringNot Applicable
fromDate The parameter accepts the From Date of the EVN BillMandatoryData Type:String Format:DD/MM/YYYY or DD/MMNot Applicable
toDate The parameter accepts the To Date of the EVN BillMandatoryData Type:String Format:DD/MM/YYYY or DD/MMNot Applicable

Sample Request

The following code shows a standard cURL request for the API:

curl --location --request POST 'https://apac.docs.hyperverge.co/v1/verifyEVN' \
--header 'Content-Type: multipart/form-data' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_HyperVerge_transactionID>' \
--form 'image1=@"<path_to_image>"' \
--form 'name="<Enter_name_on_card>"' \
--form 'address="<Enter_address_on_card>"' \
--form 'amount="<Enter_amount>"' \
--form 'evnId="<Enter_evn_id>"' \
--form 'fromDate="<Enter_from_date>"' \
--form 'toDate="<Enter_to_date>"'

Success Response Sample

The following is a sample of a success response from the API:

{
"status": "success",
"statusCode": "200",
"result": {
"name": true,
"from-date": true,
"evn-id": true,
"amount": false,
"address": true,
"to-date": true
},
"requestId": "<Request_ID>"
}

Success Response Details

ParameterTypeDescription
result.namebooleanIndicates if the name on the bill matches the user-entered name
result.from-datebooleanIndicates if the "from date" on the bill matches the user-entered "from date"
result.evn-idbooleanIndicates if the EVN ID on the bill matches the user-entered EVN ID
result.amountbooleanIndicates if the amount on the bill matches the user-entered amount
result.addressbooleanIndicates if the address on the bill matches the user-entered address
result.to-datebooleanIndicates if the "to date" on the bill matches the user-entered "to date"

Failure Response Sample

The following is a sample response when no matching record is found against the input parameter.

{
"status": "failure",
"statusCode": 400,
"error": "API call requires atlest one input image"
}

Error Response Samples

{
"status": "failure",
"statusCode": 429,
"error": "Rate limit exceeded"
}

Failure and Error Response Details

A failure or error response from the module contains a failure status, with a relavant status code and error message.

The following table lists all error responses:

Status CodeError MessageError Description
400This error is returned when 'image' is not sent in the API callThis error is returned when more than 2 images are sent in the API call
400API call handles only upto 2 imagesThis error is returned when more than 2 images are sent in the API call
400image size cannot be greater than 6MBThe maximum size of input image is 6MB. Crossing this will result in this error
429Rate limit exceededYou have exceeded the configured limit on the number of transactions permitted in a minute. Please contact the HyperVerge team for resolution
500/501Internal Server ErrorPlease check the request headers or contact the HyperVerge team for resolution
503Server busyPlease contact the HyperVerge team for resolution
Was this helpful?
Ask AIBeta
Hi! How can I help?
Ask me anything about HyperVerge products, APIs, and SDKs.
Try asking: